import javax.swing.*;

public class UserInfoFrame extends JFrame {
    public UserInfoFrame(User user) {
        super("电商购物平台-用户信息");
        setSize(400, 300);
        setLocation(600, 200);
        init(user);
        setVisible(true);
    }

    public void init(User u) {
        JTable t;
        Object[] title = {"用户名", "姓名", "密码", "性别", "城市"};
        Object[][] users = { { u.getCount(), u.getName(), u.getPassword(), u.getSex(), u.getCity() } };
        t = new JTable(users, title);
        add(new JScrollPane(t));
    }
}